<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: DTLS Support (Internal)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__dtls__internal.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">DTLS Support (Internal)</div></div>
</div><!--header-->
<div class="contents">

<p>Internal API functions for interfacing with DTLS libraries.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga84329159ac3b58cfc9a3bb7004d73231" id="r_ga84329159ac3b58cfc9a3bb7004d73231"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="group__dtls__internal.html#ga4dbea8aa6943bcf865990b5cebb6bfa4">coap_dtls_role_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga84329159ac3b58cfc9a3bb7004d73231">coap_dtls_role_t</a></td></tr>
<tr class="separator:ga84329159ac3b58cfc9a3bb7004d73231"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga4dbea8aa6943bcf865990b5cebb6bfa4" id="r_ga4dbea8aa6943bcf865990b5cebb6bfa4"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga4dbea8aa6943bcf865990b5cebb6bfa4">coap_dtls_role_t</a> { <a class="el" href="group__dtls__internal.html#gga4dbea8aa6943bcf865990b5cebb6bfa4a7f8045717b35f240ee46c987a8d9ce26">COAP_DTLS_ROLE_CLIENT</a>
, <a class="el" href="group__dtls__internal.html#gga4dbea8aa6943bcf865990b5cebb6bfa4a07db1c396fbda1115124a22b3b9cb4da">COAP_DTLS_ROLE_SERVER</a>
 }</td></tr>
<tr class="separator:ga4dbea8aa6943bcf865990b5cebb6bfa4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga18105ccd6f93d25fdeb8ce1a8791543f" id="r_ga18105ccd6f93d25fdeb8ce1a8791543f"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga18105ccd6f93d25fdeb8ce1a8791543f">coap_dtls_new_context</a> (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *coap_context)</td></tr>
<tr class="memdesc:ga18105ccd6f93d25fdeb8ce1a8791543f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new DTLS context for the given <code>coap_context</code>.  <br /></td></tr>
<tr class="separator:ga18105ccd6f93d25fdeb8ce1a8791543f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6b350a528900b867dcf0c604239b1512" id="r_ga6b350a528900b867dcf0c604239b1512"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga6b350a528900b867dcf0c604239b1512">coap_dtls_context_set_psk</a> (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *coap_context, const char *identity_hint, <a class="el" href="group__dtls__internal.html#ga4dbea8aa6943bcf865990b5cebb6bfa4">coap_dtls_role_t</a> role)</td></tr>
<tr class="memdesc:ga6b350a528900b867dcf0c604239b1512"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the DTLS context's default PSK information.  <br /></td></tr>
<tr class="separator:ga6b350a528900b867dcf0c604239b1512"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae916047df669849d71470609242f32cc" id="r_gae916047df669849d71470609242f32cc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#gae916047df669849d71470609242f32cc">coap_dtls_context_set_pki</a> (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *coap_context, <a class="el" href="structcoap__dtls__pki__t.html">coap_dtls_pki_t</a> *setup_data, <a class="el" href="group__dtls__internal.html#ga4dbea8aa6943bcf865990b5cebb6bfa4">coap_dtls_role_t</a> role)</td></tr>
<tr class="memdesc:gae916047df669849d71470609242f32cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the DTLS context's default server PKI information.  <br /></td></tr>
<tr class="separator:gae916047df669849d71470609242f32cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7f0f3e5770a16afa5a889bec3848e6aa" id="r_ga7f0f3e5770a16afa5a889bec3848e6aa"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga7f0f3e5770a16afa5a889bec3848e6aa">coap_dtls_context_set_pki_root_cas</a> (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *coap_context, const char *ca_file, const char *ca_dir)</td></tr>
<tr class="memdesc:ga7f0f3e5770a16afa5a889bec3848e6aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the dtls context's default Root CA information for a client or server.  <br /></td></tr>
<tr class="separator:ga7f0f3e5770a16afa5a889bec3848e6aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga950193b94632ac9d4325e51248043bae" id="r_ga950193b94632ac9d4325e51248043bae"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga950193b94632ac9d4325e51248043bae">coap_dtls_context_check_keys_enabled</a> (struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *coap_context)</td></tr>
<tr class="memdesc:ga950193b94632ac9d4325e51248043bae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether one of the coap_dtls_context_set_{psk|pki}() functions have been called.  <br /></td></tr>
<tr class="separator:ga950193b94632ac9d4325e51248043bae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac7aee70a85755e03f0dc0b5e8896ad29" id="r_gac7aee70a85755e03f0dc0b5e8896ad29"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#gac7aee70a85755e03f0dc0b5e8896ad29">coap_dtls_free_context</a> (void *dtls_context)</td></tr>
<tr class="memdesc:gac7aee70a85755e03f0dc0b5e8896ad29"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases the storage allocated for <code>dtls_context</code>.  <br /></td></tr>
<tr class="separator:gac7aee70a85755e03f0dc0b5e8896ad29"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga40ff9b2ab37e3244de024fc0daa6c930" id="r_ga40ff9b2ab37e3244de024fc0daa6c930"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga40ff9b2ab37e3244de024fc0daa6c930">coap_dtls_new_client_session</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session)</td></tr>
<tr class="memdesc:ga40ff9b2ab37e3244de024fc0daa6c930"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new client-side session.  <br /></td></tr>
<tr class="separator:ga40ff9b2ab37e3244de024fc0daa6c930"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga550971e2cd3fcdc4efd5a27e290563c2" id="r_ga550971e2cd3fcdc4efd5a27e290563c2"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga550971e2cd3fcdc4efd5a27e290563c2">coap_dtls_new_server_session</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session)</td></tr>
<tr class="memdesc:ga550971e2cd3fcdc4efd5a27e290563c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new DTLS server-side session.  <br /></td></tr>
<tr class="separator:ga550971e2cd3fcdc4efd5a27e290563c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga75ff6595aed94e16af18f531fe2c4e3f" id="r_ga75ff6595aed94e16af18f531fe2c4e3f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga75ff6595aed94e16af18f531fe2c4e3f">coap_dtls_free_session</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session)</td></tr>
<tr class="memdesc:ga75ff6595aed94e16af18f531fe2c4e3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Terminates the DTLS session (may send an ALERT if necessary) then frees the underlying TLS library object containing security parameters for the session.  <br /></td></tr>
<tr class="separator:ga75ff6595aed94e16af18f531fe2c4e3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga428a9ec0e5d5250da2c4167789b15393" id="r_ga428a9ec0e5d5250da2c4167789b15393"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga428a9ec0e5d5250da2c4167789b15393">coap_dtls_session_update_mtu</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session)</td></tr>
<tr class="memdesc:ga428a9ec0e5d5250da2c4167789b15393"><td class="mdescLeft">&#160;</td><td class="mdescRight">Notify of a change in the CoAP session's MTU, for example after a PMTU update.  <br /></td></tr>
<tr class="separator:ga428a9ec0e5d5250da2c4167789b15393"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5ef71c21d781100ddce5caf073eb9898" id="r_ga5ef71c21d781100ddce5caf073eb9898"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga5ef71c21d781100ddce5caf073eb9898">coap_dtls_send</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, size_t data_len)</td></tr>
<tr class="memdesc:ga5ef71c21d781100ddce5caf073eb9898"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to a DTLS peer.  <br /></td></tr>
<tr class="separator:ga5ef71c21d781100ddce5caf073eb9898"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7954de23333db4fdc4043c35022e49f5" id="r_ga7954de23333db4fdc4043c35022e49f5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga7954de23333db4fdc4043c35022e49f5">coap_dtls_is_context_timeout</a> (void)</td></tr>
<tr class="memdesc:ga7954de23333db4fdc4043c35022e49f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if timeout is handled per CoAP session or per CoAP context.  <br /></td></tr>
<tr class="separator:ga7954de23333db4fdc4043c35022e49f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0fad2bdf0101bfc40bc66bba0366d588" id="r_ga0fad2bdf0101bfc40bc66bba0366d588"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga0fad2bdf0101bfc40bc66bba0366d588">coap_dtls_get_context_timeout</a> (void *dtls_context)</td></tr>
<tr class="memdesc:ga0fad2bdf0101bfc40bc66bba0366d588"><td class="mdescLeft">&#160;</td><td class="mdescRight">Do all pending retransmits and get next timeout.  <br /></td></tr>
<tr class="separator:ga0fad2bdf0101bfc40bc66bba0366d588"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga61a68399a9abc6a222cde8cb10046805" id="r_ga61a68399a9abc6a222cde8cb10046805"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga61a68399a9abc6a222cde8cb10046805">coap_dtls_get_timeout</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session)</td></tr>
<tr class="memdesc:ga61a68399a9abc6a222cde8cb10046805"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get next timeout for this session.  <br /></td></tr>
<tr class="separator:ga61a68399a9abc6a222cde8cb10046805"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2d7e0055b0f8a3cc6514a02fa47e3ea8" id="r_ga2d7e0055b0f8a3cc6514a02fa47e3ea8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga2d7e0055b0f8a3cc6514a02fa47e3ea8">coap_dtls_handle_timeout</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session)</td></tr>
<tr class="memdesc:ga2d7e0055b0f8a3cc6514a02fa47e3ea8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle a DTLS timeout expiration.  <br /></td></tr>
<tr class="separator:ga2d7e0055b0f8a3cc6514a02fa47e3ea8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf12fde0c5f40468e42ffd06d7ad23ba8" id="r_gaf12fde0c5f40468e42ffd06d7ad23ba8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#gaf12fde0c5f40468e42ffd06d7ad23ba8">coap_dtls_receive</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, size_t data_len)</td></tr>
<tr class="memdesc:gaf12fde0c5f40468e42ffd06d7ad23ba8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handling incoming data from a DTLS peer.  <br /></td></tr>
<tr class="separator:gaf12fde0c5f40468e42ffd06d7ad23ba8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga63b38f84ef4cbc1151716284b98166bb" id="r_ga63b38f84ef4cbc1151716284b98166bb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga63b38f84ef4cbc1151716284b98166bb">coap_dtls_hello</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, size_t data_len)</td></tr>
<tr class="memdesc:ga63b38f84ef4cbc1151716284b98166bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handling client HELLO messages from a new candiate peer.  <br /></td></tr>
<tr class="separator:ga63b38f84ef4cbc1151716284b98166bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4362af8e7373ac530fd7ea8fb868b881" id="r_ga4362af8e7373ac530fd7ea8fb868b881"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga4362af8e7373ac530fd7ea8fb868b881">coap_dtls_get_overhead</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session)</td></tr>
<tr class="memdesc:ga4362af8e7373ac530fd7ea8fb868b881"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get DTLS overhead over cleartext PDUs.  <br /></td></tr>
<tr class="separator:ga4362af8e7373ac530fd7ea8fb868b881"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga410576375ba1940a5a9c8da6d96ee95f" id="r_ga410576375ba1940a5a9c8da6d96ee95f"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga410576375ba1940a5a9c8da6d96ee95f">coap_tls_new_client_session</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session, int *connected)</td></tr>
<tr class="memdesc:ga410576375ba1940a5a9c8da6d96ee95f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new TLS client-side session.  <br /></td></tr>
<tr class="separator:ga410576375ba1940a5a9c8da6d96ee95f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga549f1e9b55e423fd3e5023736ab32621" id="r_ga549f1e9b55e423fd3e5023736ab32621"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga549f1e9b55e423fd3e5023736ab32621">coap_tls_new_server_session</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session, int *connected)</td></tr>
<tr class="memdesc:ga549f1e9b55e423fd3e5023736ab32621"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a TLS new server-side session.  <br /></td></tr>
<tr class="separator:ga549f1e9b55e423fd3e5023736ab32621"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0c9463a35a0ec39a7154be45f6064a38" id="r_ga0c9463a35a0ec39a7154be45f6064a38"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga0c9463a35a0ec39a7154be45f6064a38">coap_tls_free_session</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session)</td></tr>
<tr class="memdesc:ga0c9463a35a0ec39a7154be45f6064a38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Terminates the TLS session (may send an ALERT if necessary) then frees the underlying TLS library object containing security parameters for the session.  <br /></td></tr>
<tr class="separator:ga0c9463a35a0ec39a7154be45f6064a38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga446d37acb840b785bc166d69b582edb7" id="r_ga446d37acb840b785bc166d69b582edb7"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga446d37acb840b785bc166d69b582edb7">coap_tls_write</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, size_t data_len)</td></tr>
<tr class="memdesc:ga446d37acb840b785bc166d69b582edb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to a TLS peer, with implicit flush.  <br /></td></tr>
<tr class="separator:ga446d37acb840b785bc166d69b582edb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga924fca2b98f7bc3515e8b661297ee893" id="r_ga924fca2b98f7bc3515e8b661297ee893"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga924fca2b98f7bc3515e8b661297ee893">coap_tls_read</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *coap_session, <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, size_t data_len)</td></tr>
<tr class="memdesc:ga924fca2b98f7bc3515e8b661297ee893"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read some data from a TLS peer.  <br /></td></tr>
<tr class="separator:ga924fca2b98f7bc3515e8b661297ee893"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e81d904e13ccf3af6a56ab3ebdc8a34" id="r_ga1e81d904e13ccf3af6a56ab3ebdc8a34"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga1e81d904e13ccf3af6a56ab3ebdc8a34">coap_dtls_startup</a> (void)</td></tr>
<tr class="memdesc:ga1e81d904e13ccf3af6a56ab3ebdc8a34"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the underlying (D)TLS Library layer.  <br /></td></tr>
<tr class="separator:ga1e81d904e13ccf3af6a56ab3ebdc8a34"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0caf72509389aca217add5fbaa125f52" id="r_ga0caf72509389aca217add5fbaa125f52"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dtls__internal.html#ga0caf72509389aca217add5fbaa125f52">coap_endpoint_new_dtls_session</a> (<a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *endpoint, const struct <a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *packet, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="memdesc:ga0caf72509389aca217add5fbaa125f52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new DTLS session for the <code>endpoint</code>.  <br /></td></tr>
<tr class="separator:ga0caf72509389aca217add5fbaa125f52"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Internal API functions for interfacing with DTLS libraries. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga84329159ac3b58cfc9a3bb7004d73231" name="ga84329159ac3b58cfc9a3bb7004d73231"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga84329159ac3b58cfc9a3bb7004d73231">&#9670;&#160;</a></span>coap_dtls_role_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef enum <a class="el" href="group__dtls__internal.html#ga4dbea8aa6943bcf865990b5cebb6bfa4">coap_dtls_role_t</a> <a class="el" href="group__dtls__internal.html#ga4dbea8aa6943bcf865990b5cebb6bfa4">coap_dtls_role_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga4dbea8aa6943bcf865990b5cebb6bfa4" name="ga4dbea8aa6943bcf865990b5cebb6bfa4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4dbea8aa6943bcf865990b5cebb6bfa4">&#9670;&#160;</a></span>coap_dtls_role_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__dtls__internal.html#ga4dbea8aa6943bcf865990b5cebb6bfa4">coap_dtls_role_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga4dbea8aa6943bcf865990b5cebb6bfa4a7f8045717b35f240ee46c987a8d9ce26" name="gga4dbea8aa6943bcf865990b5cebb6bfa4a7f8045717b35f240ee46c987a8d9ce26"></a>COAP_DTLS_ROLE_CLIENT&#160;</td><td class="fielddoc"><p>Internal function invoked for client. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga4dbea8aa6943bcf865990b5cebb6bfa4a07db1c396fbda1115124a22b3b9cb4da" name="gga4dbea8aa6943bcf865990b5cebb6bfa4a07db1c396fbda1115124a22b3b9cb4da"></a>COAP_DTLS_ROLE_SERVER&#160;</td><td class="fielddoc"><p>Internal function invoked for server. </p>
</td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="coap__dtls_8h_source.html#l00264">264</a> of file <a class="el" href="coap__dtls_8h_source.html">coap_dtls.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga950193b94632ac9d4325e51248043bae" name="ga950193b94632ac9d4325e51248043bae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga950193b94632ac9d4325e51248043bae">&#9670;&#160;</a></span>coap_dtls_context_check_keys_enabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_dtls_context_check_keys_enabled </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>coap_context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check whether one of the coap_dtls_context_set_{psk|pki}() functions have been called. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_context</td><td>The current <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if coap_dtls_context_set_{psk|pki}() called, else <code>0</code>. </dd></dl>

</div>
</div>
<a id="gae916047df669849d71470609242f32cc" name="gae916047df669849d71470609242f32cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae916047df669849d71470609242f32cc">&#9670;&#160;</a></span>coap_dtls_context_set_pki()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_dtls_context_set_pki </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>coap_context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__dtls__pki__t.html">coap_dtls_pki_t</a> *&#160;</td>
          <td class="paramname"><em>setup_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__dtls__internal.html#ga4dbea8aa6943bcf865990b5cebb6bfa4">coap_dtls_role_t</a>&#160;</td>
          <td class="paramname"><em>role</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the DTLS context's default server PKI information. </p>
<p>This does the PKI specifics following <a class="el" href="group__dtls__internal.html#ga18105ccd6f93d25fdeb8ce1a8791543f" title="Creates a new DTLS context for the given coap_context.">coap_dtls_new_context()</a>. If <code>COAP_DTLS_ROLE_SERVER</code>, then the information will get put into the TLS library's context (from which sessions are derived). If <code>COAP_DTLS_ROLE_CLIENT</code>, then the information will get put into the TLS library's session.</p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_context</td><td>The CoAP context. </td></tr>
    <tr><td class="paramname">setup_data</td><td>Setup information defining how PKI is to be setup. Required parameter. If <code>NULL</code>, PKI will not be set up. </td></tr>
    <tr><td class="paramname">role</td><td>One of <code>COAP_DTLS_ROLE_CLIENT</code> or <code>COAP_DTLS_ROLE_SERVER</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if successful, else <code>0</code>. </dd></dl>

</div>
</div>
<a id="ga7f0f3e5770a16afa5a889bec3848e6aa" name="ga7f0f3e5770a16afa5a889bec3848e6aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7f0f3e5770a16afa5a889bec3848e6aa">&#9670;&#160;</a></span>coap_dtls_context_set_pki_root_cas()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_dtls_context_set_pki_root_cas </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>coap_context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ca_file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ca_dir</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the dtls context's default Root CA information for a client or server. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_context</td><td>The current <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object. </td></tr>
    <tr><td class="paramname">ca_file</td><td>If not <code>NULL</code>, is the full path name of a PEM encoded file containing all the Root CAs to be used. </td></tr>
    <tr><td class="paramname">ca_dir</td><td>If not <code>NULL</code>, points to a directory containing PEM encoded files containing all the Root CAs to be used.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if successful, else <code>0</code>. </dd></dl>

</div>
</div>
<a id="ga6b350a528900b867dcf0c604239b1512" name="ga6b350a528900b867dcf0c604239b1512"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6b350a528900b867dcf0c604239b1512">&#9670;&#160;</a></span>coap_dtls_context_set_psk()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_dtls_context_set_psk </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>coap_context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>identity_hint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__dtls__internal.html#ga4dbea8aa6943bcf865990b5cebb6bfa4">coap_dtls_role_t</a>&#160;</td>
          <td class="paramname"><em>role</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the DTLS context's default PSK information. </p>
<p>This does the PSK specifics following <a class="el" href="group__dtls__internal.html#ga18105ccd6f93d25fdeb8ce1a8791543f" title="Creates a new DTLS context for the given coap_context.">coap_dtls_new_context()</a>. If <code>COAP_DTLS_ROLE_SERVER</code>, then identity hint will also get set. If <code>COAP_DTLS_ROLE_SERVER</code>, then the information will get put into the TLS library's context (from which sessions are derived). If <code>COAP_DTLS_ROLE_CLIENT</code>, then the information will get put into the TLS library's session.</p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_context</td><td>The CoAP context. </td></tr>
    <tr><td class="paramname">identity_hint</td><td>The default PSK server identity hint sent to a client. Required parameter. If <code>NULL</code>, will be set to "". Empty string is a valid hint. This parameter is ignored if COAP_DTLS_ROLE_CLIENT </td></tr>
    <tr><td class="paramname">role</td><td>One of <code>COAP_DTLS_ROLE_CLIENT</code> or <code>COAP_DTLS_ROLE_SERVER</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if successful, else <code>0</code>. </dd></dl>

</div>
</div>
<a id="gac7aee70a85755e03f0dc0b5e8896ad29" name="gac7aee70a85755e03f0dc0b5e8896ad29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac7aee70a85755e03f0dc0b5e8896ad29">&#9670;&#160;</a></span>coap_dtls_free_context()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_dtls_free_context </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dtls_context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Releases the storage allocated for <code>dtls_context</code>. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dtls_context</td><td>The DTLS context as returned by <a class="el" href="group__dtls__internal.html#ga18105ccd6f93d25fdeb8ce1a8791543f" title="Creates a new DTLS context for the given coap_context.">coap_dtls_new_context()</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga75ff6595aed94e16af18f531fe2c4e3f" name="ga75ff6595aed94e16af18f531fe2c4e3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga75ff6595aed94e16af18f531fe2c4e3f">&#9670;&#160;</a></span>coap_dtls_free_session()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_dtls_free_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Terminates the DTLS session (may send an ALERT if necessary) then frees the underlying TLS library object containing security parameters for the session. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga0fad2bdf0101bfc40bc66bba0366d588" name="ga0fad2bdf0101bfc40bc66bba0366d588"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0fad2bdf0101bfc40bc66bba0366d588">&#9670;&#160;</a></span>coap_dtls_get_context_timeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> coap_dtls_get_context_timeout </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dtls_context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Do all pending retransmits and get next timeout. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dtls_context</td><td>The DTLS context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> if no event is pending or date of the next retransmit. </dd></dl>

</div>
</div>
<a id="ga4362af8e7373ac530fd7ea8fb868b881" name="ga4362af8e7373ac530fd7ea8fb868b881"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4362af8e7373ac530fd7ea8fb868b881">&#9670;&#160;</a></span>coap_dtls_get_overhead()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int coap_dtls_get_overhead </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get DTLS overhead over cleartext PDUs. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Maximum number of bytes added by DTLS layer. </dd></dl>

</div>
</div>
<a id="ga61a68399a9abc6a222cde8cb10046805" name="ga61a68399a9abc6a222cde8cb10046805"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga61a68399a9abc6a222cde8cb10046805">&#9670;&#160;</a></span>coap_dtls_get_timeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> coap_dtls_get_timeout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get next timeout for this session. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> If no event is pending or date of the next retransmit. </dd></dl>

</div>
</div>
<a id="ga2d7e0055b0f8a3cc6514a02fa47e3ea8" name="ga2d7e0055b0f8a3cc6514a02fa47e3ea8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2d7e0055b0f8a3cc6514a02fa47e3ea8">&#9670;&#160;</a></span>coap_dtls_handle_timeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_dtls_handle_timeout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Handle a DTLS timeout expiration. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga63b38f84ef4cbc1151716284b98166bb" name="ga63b38f84ef4cbc1151716284b98166bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga63b38f84ef4cbc1151716284b98166bb">&#9670;&#160;</a></span>coap_dtls_hello()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_dtls_hello </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Handling client HELLO messages from a new candiate peer. </p>
<p>Note that session-&gt;tls is empty.</p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">data</td><td>Encrypted datagram. </td></tr>
    <tr><td class="paramname">data_len</td><td>Encrypted datagram size.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> if a cookie verification message has been sent, <code>1</code> if the HELLO contains a valid cookie and a server session should be created, <code>-1</code> if the message is invalid. </dd></dl>

</div>
</div>
<a id="ga7954de23333db4fdc4043c35022e49f5" name="ga7954de23333db4fdc4043c35022e49f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7954de23333db4fdc4043c35022e49f5">&#9670;&#160;</a></span>coap_dtls_is_context_timeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_dtls_is_context_timeout </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if timeout is handled per CoAP session or per CoAP context. </p>
<p>Internal function.</p>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> of timeout and retransmit is per context, <code>0</code> if it is per session. </dd></dl>

<p class="definition">Definition at line <a class="el" href="coap__notls_8c_source.html#l00116">116</a> of file <a class="el" href="coap__notls_8c_source.html">coap_notls.c</a>.</p>

</div>
</div>
<a id="ga40ff9b2ab37e3244de024fc0daa6c930" name="ga40ff9b2ab37e3244de024fc0daa6c930"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga40ff9b2ab37e3244de024fc0daa6c930">&#9670;&#160;</a></span>coap_dtls_new_client_session()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * coap_dtls_new_client_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new client-side session. </p>
<p>This should send a HELLO to the server.</p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Opaque handle to underlying TLS library object containing security parameters for the session. </dd></dl>

</div>
</div>
<a id="ga18105ccd6f93d25fdeb8ce1a8791543f" name="ga18105ccd6f93d25fdeb8ce1a8791543f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga18105ccd6f93d25fdeb8ce1a8791543f">&#9670;&#160;</a></span>coap_dtls_new_context()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * coap_dtls_new_context </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>coap_context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new DTLS context for the given <code>coap_context</code>. </p>
<p>This function returns a pointer to a new DTLS context object or <code>NULL</code> on error.</p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_context</td><td>The CoAP context where the DTLS object shall be used.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A DTLS context object or <code>NULL</code> on error. </dd></dl>

</div>
</div>
<a id="ga550971e2cd3fcdc4efd5a27e290563c2" name="ga550971e2cd3fcdc4efd5a27e290563c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga550971e2cd3fcdc4efd5a27e290563c2">&#9670;&#160;</a></span>coap_dtls_new_server_session()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * coap_dtls_new_server_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new DTLS server-side session. </p>
<p>Called after <a class="el" href="group__dtls__internal.html#ga63b38f84ef4cbc1151716284b98166bb" title="Handling client HELLO messages from a new candiate peer.">coap_dtls_hello()</a> has returned <code>1</code>, signalling that a validated HELLO was received from a client. This should send a HELLO to the server.</p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Opaque handle to underlying TLS library object containing security parameters for the DTLS session. </dd></dl>

</div>
</div>
<a id="gaf12fde0c5f40468e42ffd06d7ad23ba8" name="gaf12fde0c5f40468e42ffd06d7ad23ba8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf12fde0c5f40468e42ffd06d7ad23ba8">&#9670;&#160;</a></span>coap_dtls_receive()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_dtls_receive </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Handling incoming data from a DTLS peer. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">data</td><td>Encrypted datagram. </td></tr>
    <tr><td class="paramname">data_len</td><td>Encrypted datagram size.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of coap_handle_dgram on the decrypted CoAP PDU or <code>-1</code> for error. </dd></dl>

</div>
</div>
<a id="ga5ef71c21d781100ddce5caf073eb9898" name="ga5ef71c21d781100ddce5caf073eb9898"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5ef71c21d781100ddce5caf073eb9898">&#9670;&#160;</a></span>coap_dtls_send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_dtls_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send data to a DTLS peer. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">data</td><td>pointer to data. </td></tr>
    <tr><td class="paramname">data_len</td><td>Number of bytes to send.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> if this would be blocking, <code>-1</code> if there is an error or the number of cleartext bytes sent. </dd></dl>

</div>
</div>
<a id="ga428a9ec0e5d5250da2c4167789b15393" name="ga428a9ec0e5d5250da2c4167789b15393"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga428a9ec0e5d5250da2c4167789b15393">&#9670;&#160;</a></span>coap_dtls_session_update_mtu()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_dtls_session_update_mtu </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Notify of a change in the CoAP session's MTU, for example after a PMTU update. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1e81d904e13ccf3af6a56ab3ebdc8a34" name="ga1e81d904e13ccf3af6a56ab3ebdc8a34"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1e81d904e13ccf3af6a56ab3ebdc8a34">&#9670;&#160;</a></span>coap_dtls_startup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_dtls_startup </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the underlying (D)TLS Library layer. </p>
<p>Internal function. </p>

<p class="definition">Definition at line <a class="el" href="coap__notls_8c_source.html#l00072">72</a> of file <a class="el" href="coap__notls_8c_source.html">coap_notls.c</a>.</p>

</div>
</div>
<a id="ga0caf72509389aca217add5fbaa125f52" name="ga0caf72509389aca217add5fbaa125f52"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0caf72509389aca217add5fbaa125f52">&#9670;&#160;</a></span>coap_endpoint_new_dtls_session()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__session__t.html">coap_session_t</a> * coap_endpoint_new_dtls_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new DTLS session for the <code>endpoint</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">endpoint</td><td>Endpoint to add DTLS session to </td></tr>
    <tr><td class="paramname">packet</td><td>Received packet information to base session on. </td></tr>
    <tr><td class="paramname">now</td><td>The current time in ticks.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Created CoAP session or <code>NULL</code> if error. </dd></dl>

</div>
</div>
<a id="ga0c9463a35a0ec39a7154be45f6064a38" name="ga0c9463a35a0ec39a7154be45f6064a38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0c9463a35a0ec39a7154be45f6064a38">&#9670;&#160;</a></span>coap_tls_free_session()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_tls_free_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Terminates the TLS session (may send an ALERT if necessary) then frees the underlying TLS library object containing security parameters for the session. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga410576375ba1940a5a9c8da6d96ee95f" name="ga410576375ba1940a5a9c8da6d96ee95f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga410576375ba1940a5a9c8da6d96ee95f">&#9670;&#160;</a></span>coap_tls_new_client_session()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * coap_tls_new_client_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>connected</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new TLS client-side session. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">connected</td><td>Updated with whether the connection is connected yet or not. <code>0</code> is not connected, <code>1</code> is connected.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Opaque handle to underlying TLS library object containing security parameters for the session. </dd></dl>

</div>
</div>
<a id="ga549f1e9b55e423fd3e5023736ab32621" name="ga549f1e9b55e423fd3e5023736ab32621"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga549f1e9b55e423fd3e5023736ab32621">&#9670;&#160;</a></span>coap_tls_new_server_session()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * coap_tls_new_server_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>connected</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a TLS new server-side session. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">connected</td><td>Updated with whether the connection is connected yet or not. <code>0</code> is not connected, <code>1</code> is connected.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Opaque handle to underlying TLS library object containing security parameters for the session. </dd></dl>

</div>
</div>
<a id="ga924fca2b98f7bc3515e8b661297ee893" name="ga924fca2b98f7bc3515e8b661297ee893"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga924fca2b98f7bc3515e8b661297ee893">&#9670;&#160;</a></span>coap_tls_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssize_t coap_tls_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read some data from a TLS peer. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">data</td><td>Pointer to data. </td></tr>
    <tr><td class="paramname">data_len</td><td>Maximum number of bytes to read.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> if this should be retried, <code>-1</code> if there is an error or the number of cleartext bytes read. </dd></dl>

</div>
</div>
<a id="ga446d37acb840b785bc166d69b582edb7" name="ga446d37acb840b785bc166d69b582edb7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga446d37acb840b785bc166d69b582edb7">&#9670;&#160;</a></span>coap_tls_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssize_t coap_tls_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>coap_session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send data to a TLS peer, with implicit flush. </p>
<p>Internal function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">coap_session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">data</td><td>Pointer to data. </td></tr>
    <tr><td class="paramname">data_len</td><td>Number of bytes to send.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> if this should be retried, <code>-1</code> if there is an error or the number of cleartext bytes sent. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
